# LuckPay Web Manage System
#
# Copyright (c) 2016 Lucky Byte, Inc.
#
express = require 'express'
router = express.Router()
module.exports = router


router.all '/', (req, res, next) ->
    # 如果没有提供日期，则仅查询当日
    start_date = req.body.start_date or \
        req.query.start_date or moment().format('YYYY-MM-DD')
    end_date = req.body.end_date or \
        req.query.end_date or moment().format('YYYY-MM-DD')

    return res.redirect """
        /trstat/trcodes?start_date=#{start_date}&end_date=#{end_date}
    """
